package com.yuki.fwwb.Service;

import com.yuki.fwwb.DAO.WeatherDao;
import com.yuki.fwwb.Entity.Weather;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WeatherService {

    @Autowired
    WeatherDao weatherDao;

    public Weather findWeatherByDay(String month, String day) {
        String monthDay = "2020-"+month+"-"+day;
        System.out.println(monthDay);
        return weatherDao.findWeatherByDay(monthDay);
    }

    public List<Weather> findWeatherByMonth(String month) {
        String yearMonth = "2020-" + month;
        System.out.println(yearMonth);
         return weatherDao.findWeatherByMonth(yearMonth);
    }
}
